#ifndef __VV_VSET_HPP__
#define __VV_VSET_HPP__

#include <set>
#include <string>
#include "vertex.hpp"

namespace vv {
  /** @brief A vertex iterator for sets */
  class vset_iterator : public abstract_vertex_iterator {
  public:
    vset_iterator(std::set<abstract_vertex*>::iterator start, std::set<abstract_vertex*>::iterator end);
    vptr first();
    vptr advance();
    bool not_finished();
  private:
    std::set<abstract_vertex*>::iterator start;
    std::set<abstract_vertex*>::iterator end;
    std::set<abstract_vertex*>::iterator current;
  };

  /** @brief An unordered collection of vertices */
  class vset {
  public:
    // vertex operations
    void add(vptr v);
    void remove(vptr v);
    void synchronise();

    // set operations
    void operator= (const vset& s);
    void operator+=(const vset& s);
    void operator-=(const vset& s);

    // iteration
    vset_iterator* iter();

  private:
    typedef std::set<abstract_vertex*> vs;
    typedef vs::iterator vsiter;

    vs vertices;
  };
}

#endif
